package cn.itcast.dao;

import cn.itcast.domain.Account;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface AccountDao {
    @Select("SELECT * FROM account")
    List<Account> findAll();
    @Delete("DELETE FROM account WHERE id=#{id}")
    int delete(Integer id);
    @Update("UPDATE account SET money=#{money} WHERE id=#{id}")
    int update(Account account);
    @Insert("INSERT INTO account (`id`,`name`,`money`)VALUES(#{id},#{name},#{money})")
    int add(Account account);
}
